**********************************************************************************************
***************************       Replication Do File     ************************************
*****Sexual Violence in the Shadows:Private Military Contractors and the Perpetration of Sexual Violence******
**********************************************************************************************



*********Estimating full model to generate descriptive stats**********
ologit maxSVAC PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



*********Table 1 Descriptive Statistics*********
sum maxSVAC PMSCGov AM_Comp GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if e(sample)




********Table 2 Model 1********
ologit maxSVAC PMSCGov if StateActor==1, cluster(warnum)




********Table 2 Model 2********
ologit maxSVAC PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)




********Table 3 Model 3********
ologit maxSVAC GWOT_PMC PMSCGov GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



********Table 3 Model 4********
ologit maxSVAC AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)




********Table 3 Model 5********
ologit maxSVAC AM_GWOT GWOT AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)





**************************************************************************************************
*************************************CLARIFY FOR MAIN MODELS**************************************
**************************************************************************************************


***************H1***************

estsimp ologit maxSVAC PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

setx PMSCGov 0 Reb_maxSVAC mean Polity mean duration mean PKOMission mean TerrCont mean FR_year mean ln_gdppc mean ln_BattleDeaths mean ethfrac mean lagmaxSVAC mean

simqi, level(95)

drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 


estsimp ologit maxSVAC PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

setx PMSCGov 1 Reb_maxSVAC mean Polity mean duration mean PKOMission mean TerrCont mean FR_year mean ln_gdppc mean ln_BattleDeaths mean ethfrac mean lagmaxSVAC mean

simqi, level(95)

drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14

********Import attached Excel file data for these and run codes for visuals********

clear

import delimited "H1_Clarify.csv"

rename v1 PredVal
rename v2 Low
rename v3 High 
rename v4 ConPres
rename v5 SVAC

*Generating variable to make graph*
gen ConCat = ConPres if SVAC==0
replace ConCat = ConPres+5 if SVAC==1
replace ConCat = ConPres+10 if SVAC==2
replace ConCat = ConPres+15 if SVAC==3

*Graph output for Figure 1*
twoway (bar PredVal ConCat if ConPres==0) (bar PredVal ConCat if ConPres==1) (rcap High Low ConCat), legend( order(1 "No PMC Intervention" 2 "PMC Intervention")) xlabel( 1 "None" 6 "Isolated" 11 "Numerous" 16 "Massive", noticks) xtitle("Sexual Violence Prevalence by State") ytitle("Predicted Value of SVAC by PMC Presence")



**********************Figure 4************************
use "Contract_SVAC.dta", clear

estsimp ologit maxSVAC AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

setx AM_Comp 0 Reb_maxSVAC mean Polity mean duration mean PKOMission mean TerrCont mean FR_year mean ln_gdppc mean ln_BattleDeaths mean ethfrac mean lagmaxSVAC mean

simqi, level(95)

drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 


estsimp ologit maxSVAC AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

setx AM_Comp 1 Reb_maxSVAC mean Polity mean duration mean PKOMission mean TerrCont mean FR_year mean ln_gdppc mean ln_BattleDeaths mean ethfrac mean lagmaxSVAC mean

simqi, level(95)


drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 


********Import attached Excel file data for these and run codes for visuals********

clear

import delimited "AM_Presence.csv"

rename v1 PredVal
rename v2 Low
rename v3 High 
rename v4 ConPres
rename v5 SVAC

*Generating variable to make pretty graph*
gen ConCat = ConPres if SVAC==0
replace ConCat = ConPres+5 if SVAC==1
replace ConCat = ConPres+10 if SVAC==2
replace ConCat = ConPres+15 if SVAC==3

*Graph output*
twoway (bar PredVal ConCat if ConPres==0) (bar PredVal ConCat if ConPres==1) (rcap High Low ConCat), legend( order(1 "US PMC Present" 2 "US PMC Absent")) xlabel( 1 "None" 6 "Isolated" 11 "Numerous" 16 "Massive", noticks) xtitle("State SVAC Prevalence") ytitle("Predicted Value of SVAC by US PMC Presence")







********************Figure 3**********************

use "Contract_SVAC.dta", clear

*********Interaction for GWOT***********
ologit maxSVAC i.PMSCGov##i.GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

margins PMSCGov, at(GWOT==0)

marginsplot

graph save "PreGWOT.gph"


ologit state_prev i.PMSCGov##i.GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

margins PMSCGov, at(GWOT==1)

marginsplot

graph save "GWOT.gph"


graph combine "PreGWOT.gph" "GWOT.gph"



******For Figure 4******

ologit maxSVAC i.AM_Comp##i.GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)
margins AM_Comp, at(GWOT==0)

marginsplot

graph save "AmericanPreGWOT.gph"


ologit maxSVAC i.AM_Comp##i.GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

margins AM_Comp, at(GWOT==1)

marginsplot

graph save "AmericanGWOT.gph"

graph combine "AmericanPreGWOT.gph" "AmericanGWOT.gph"






****************************************************************************************************
************************************************APPENDIX********************************************
****************************************************************************************************



*******************Table A1: Tabulations of Independent Variables********************

****Model 2*****
ologit maxSVAC PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

tab PMSCGov if e(sample)


********Model 3********
ologit maxSVAC GWOT_PMC PMSCGov GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

tab PMSCGov GWOT if e(sample)



********Model 4********
ologit maxSVAC AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

tab AM_Comp if e(sample)


********Model 5********
ologit maxSVAC AM_GWOT GWOT AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)

tab AM_Comp GWOT if e(sample)





***************Table A2: Base Models for Main Paper*****************


****Model 3*****
ologit maxSVAC GWOT_PMC PMSCGov GWOT if StateActor==1, cluster(warnum)


****Model 4*****
ologit maxSVAC AM_Comp if StateActor==1, cluster(warnum)


****Model 5*****
ologit maxSVAC AM_GWOT GWOT AM_Comp if StateActor==1, cluster(warnum)





********************Table A3: Using dichotomous SVAC score*****************


*********Model 1*********
logit SV PMSCGov Reb_Bin_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



*********Model 2*********
logit SV GWOT_PMC PMSCGov GWOT Reb_Bin_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



*********Model 3*********
logit SV AM_Comp Reb_Bin_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



*********Model 4*********
logit SV AM_GWOT GWOT AM_Comp Reb_Bin_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)





****************************Table A4: Using Lagged Independent Variable******************************


*********Model 1*********
ologit maxSVAC PMClag Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)




*********Model 2*********
ologit maxSVAC lag_PMC_GWOT PMClag GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)




*********Model 3*********
ologit maxSVAC lag_AM Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)




*********Model 4*********
ologit maxSVAC lag_AM_GWOT GWOT lag_AM Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)






****************************Table A5: Using Inverse Probability Weights*****************************


********Re-estimating Model 2 in paper********
//manually generate propensity scores w/probit
//use covariates from the model
probit PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)
predict propscore1, pr


//manually generate inverse probability weights
gen ipweights1 = .

//inverse probability of PMSCGov=1 for wars in which PMSCGov=1
replace ipweights1 = 1/propscore1 if PMSCGov==1

//inverse probability of PMSCGov=0 for wars in which PMSCGov=0
replace ipweights1 = 1/(1-propscore1) if PMSCGov==0

//check the mean of the weights, should be around 2 if constructed properly
sum ipweights1


//Re-estimating model 2 w/manually-generated ipw weights
***Model 1 in Table A5***
ologit maxSVAC PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC [pweight=ipweights1] if StateActor==1, cluster(warnum)




********Re-estimating Model 3 in paper********
//manually generate propensity scores w/probit
//use covariates from the model
probit PMSCGov GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1
predict propscore2, pr


//manually generate inverse probability weights
gen ipweights2 = .

//inverse probability of PMSCGov=1 for wars in which PMSCGov=1
replace ipweights2 = 1/propscore2 if PMSCGov==1

//inverse probability of PMSCGov=0 for wars in which PMSCGov=0
replace ipweights2 = 1/(1-propscore2) if PMSCGov==0

//check the mean of the weights, should be around 2 if constructed properly
sum ipweights2


//re-estimating model 3 w/manually-generated ipw weights
***Model 2 in Table A5***
ologit maxSVAC i.PMSCGov##i.GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC [pweight=ipweights2] if StateActor==1, cluster(warnum)




********Re-estimating Model 4 in paper********
//manually generate propensity scores w/probit
//use covariates from the model
probit AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1
predict propscore3, pr


//manually generate inverse probability weights
gen ipweights3 = .

//inverse probability of PMSCGov=1 for wars in which PMSCGov=1
replace ipweights3 = 1/propscore3 if AM_Comp==1

//inverse probability of PMSCGov=0 for wars in which PMSCGov=0
replace ipweights3 = 1/(1-propscore3) if AM_Comp==0

//check the mean of the weights, should be around 2 if constructed properly
sum ipweights3


//re-estimating model 4 w/manually-generated ipw weights
***Model 3 in Table A5***
ologit maxSVAC AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC [pweight=ipweights3] if StateActor==1, cluster(warnum)




********Re-estimating Model 5 in paper********
//manually generate propensity scores w/probit
//use covariates from the model
probit GWOT AM_Comp Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1
predict propscore4, pr


//manually generate inverse probability weights
gen ipweights4 = .

//inverse probability of PMSCGov=1 for wars in which PMSCGov=1
replace ipweights4 = 1/propscore4 if AM_Comp==1

//inverse probability of PMSCGov=0 for wars in which PMSCGov=0
replace ipweights4 = 1/(1-propscore4) if AM_Comp==0

//check the mean of the weights, should be around 2 if constructed properly
sum ipweights4


//re-estimating model 5 w/manually-generated ipw weights
***Model 4 in Table A5***
ologit maxSVAC i.AM_Comp##i.GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC [pweight=ipweights4] if StateActor==1, cluster(warnum)






**********************Table A6: Additional Tests of Human Rights Abuses and GWOT******************************

***Model 1: PTS***
ologit maxSVAC PTS_S Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



***Model 2: GWOT and PTS***
ologit maxSVAC GWOT PTS_S Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



***Model 3: PTS and PMSC Interaction***
gen PTS_PMC = PTS_S * PMSCGov

ologit state_prev PTS_PMC PTS_S PMSCGov Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



*******************American vs. Non-American PMCs*********************

***Model 4***
. gen American=.


. replace American=1 if americanhired==1 & PMSCGov==1 & StateActor==1


. replace American=0 if americanhired==0 & PMSCGov==1 & StateActor==1


ologit maxSVAC American Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



***Model 5***
ologit maxSVAC i.American##i.GWOT Reb_maxSVAC Polity duration PKOMission TerrCont FR_year ln_gdppc ln_BattleDeaths ethfrac lagmaxSVAC if StateActor==1, cluster(warnum)



